#ifndef XMLPARSER_H
#define XMLPARSER_H
//includes
#include <QObject>
#include <QXmlDefaultHandler>
#include <QXmlParseException>
#include <QXmlAttributes>
#include <QString>

#include "rssleaf.h"
#include "rsschannel.h"
//
class XmlParser : public  QObject, public QXmlDefaultHandler
{
Q_OBJECT

public:
	XmlParser();

	~XmlParser();
	
public:
	bool startDocument();
	bool endDocument();
	bool startElement ( const QString & namespaceURI, const QString & localName, const QString & qName, const QXmlAttributes & atts );
	bool endElement ( const QString & namespaceURI, const QString & localName, const QString & qName );
	bool characters( const QString &chars );
	
	bool fatalError( const QXmlParseException &exception );

signals:
	void documentEnd( RssChannel* );

private:
	void init();

private:
	RssLeaf*	m_leaf;
	RssChannel*	m_channel;
	QString		m_data;
};
#endif
